package com.server;import org.springframework.amqp.core.AmqpTemplate;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Component;import java.util.Date;/** * Description: * Company:HK * author: Sam * date:  2016/11/15 18:18 */@Componentpublic class Sender {    @Autowired    private AmqpTemplate rabbitTemplate;    public void send() {        String context = "hello " + new Date();        System.out.println("Sender : " + context);        this.rabbitTemplate.convertAndSend("msgQueue", context);    }}